package com.sven.hello;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.SendTo;

/**
 * 消息中转类
 * app2接收app1的消息，转发给app3
 */
@EnableBinding(SendToBinder.class)
public class SendToService {

    @StreamListener(SendToBinder.INPUT)
    @SendTo(SendToBinder.OUTPUT)
    public Object receiveFromInput(Object payload){
        System.out.println("中转消息。。"+payload);
        return payload;
    }
}
